<#macro categoryTree parentId=''>
    <@_categoryList parentId=parentId>
        <#list page.list as a>
            <li>
                <a href="cmsPlace/lookup_content_list.html?categoryId=${a.id}" target="ajax" rel="lookup_content_list">${a.name!}</a>
            <#if a.childIds?has_content>
                <ul>
                    <@categoryTree a.id/>
                </ul>
            </#if>
            </li>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_categoryList>
</#macro>
<#macro lookupTree parentId=''>
    <@_categoryList parentId=parentId>
        <#list page.list as a>
            <li>
                <a href="javascript:;" onclick="$.bringBack({itemType:'category',itemId:'${a.id}',title:'${a.name}',url:'${a.url}'});return false;">${a.name!}</a>
            <#if a.childIds?has_content>
                <ul>
                    <@lookupTree a.id/>
                </ul>
            </#if>
            </li>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_categoryList>
</#macro>
<#macro pageTree filepath=''>
    <@_templateList path=filepath>
        <@_metadata dir=filepath><#local metadataMap=object/></@_metadata>
        <#list list as a>
            <#local path=filepath+'/'+a.fileName>
            <li>
                <#if a.directory>
                    <a href="javascript:;" onclick="return false;">
                        ${a.fileName} ${(metadataMap[a.fileName].alias)?has_content?then('('+metadataMap[a.fileName].alias+')','')}
                    </a>
                    <ul>
                        <@pageTree path/>
                    </ul>
                <#else>
                    <#if site.useStatic&&(metadataMap[a.fileName].publishPath)?has_content>
                        <a href="javascript" onclick="$.bringBack({itemType:'page',title:'${(metadataMap[a.fileName].alias)!}',url:'${site.sitePath+metadataMap[a.fileName].publishPath}'});return false;">
                            [<@t.page 'static_page'/>] ${a.fileName} ${(metadataMap[a.fileName].alias)?has_content?then('('+metadataMap[a.fileName].alias+')','')}
                        </a>
                    </#if>
                    <#if (metadataMap[a.fileName].useDynamic)?has_content&&metadataMap[a.fileName].useDynamic>
                        <a href="javascript" onclick="$.bringBack({itemType:'page',title:'${(metadataMap[a.fileName].alias)!}',url:'${site.dynamicPath+path}<#if (metadataMap[a.fileName].acceptParamters)?has_content><#list metadataMap[a.fileName].acceptParamters?split(',') as a><#if a?is_first>?<#else>#</#if>${a}=</#list></#if>'});return false;">
                            [<@t.page 'dynamic_page'/>] ${a.fileName} ${(metadataMap[a.fileName].alias)?has_content?then('('+metadataMap[a.fileName].alias+')','')}
                        </a>
                    </#if>
                </#if>
            </li>
        <#else>
            <li><a><@t.page 'empty_directory'/></a></li>
        </#list>
    </@_templateList>
</#macro>
<div class="tabs">
    <div class="tabsHeader">
        <div class="tabsHeaderContent">
            <ul>
                <li><a href="javascript:;" onclick="return false;"><@t.page 'content'/></a></li>
                <li><a href="javascript:;" onclick="return false;"><@t.page 'category'/></a></li>
                <li><a href="javascript:;" onclick="return false;"><@t.page 'page'/></a></li>
            </ul>
        </div>
    </div>
    <div class="tabsContent">
        <div class="pageContent" layoutH="37">
            <div class="unitBox" layoutH="37" style="float:left; display:block; overflow:auto; width:180px;border-right:solid 1px #CCC;">
                <ul class="tree treeFolder">
                    <li>
                        <a href="cmsPlace/lookup_content_list.html" target="ajax" rel="lookup_content_list"><@t.page 'category'/></a>
                        <ul>
                            <@categoryTree/>
                        </ul>
                    </li>
                 </ul>
            </div>
            <div id="lookup_content_list" class="unitBox" style="margin-left:180px;">
                <#include "lookup_content_list.html"/>
            </div>
        </div>
        <div class="pageFormContent" layoutH="37">
            <ul class="tree treeFolder expand">
                <@lookupTree/>
            </ul>
        </div>
        <div class="pageFormContent" layoutH="37">
            <ul class="tree treeFolder expand">
                <@pageTree/>
            </ul>
        </div>
    </div>
</div>